<?=isset($header) ? $header : ''?>
<div id="content">
	<div class="form_style">
		<!-- nav1 start-->
		<form method="post" action="/client/batch_data_delete" id="userinfo">
			<table>
				<thead>
					<tr>
						<th width="40px">選擇</th>
						<th width="70px">客戶姓名</th>
						<th>需求等級</th>
						<th>建物面積</th>
						<th>室內面積</th>
						<th>土地面積</th>
						<th>路段</th>
						<th>區域</th>
						<th>商圈</th>
						<th>總預算</th>
						<th>經紀人</th>						
						<th>物件用途</th>
						<th>需求類別</th>
						<th>建檔日期</th>
						<th width="70px">操作</th>
					</tr>
				</thead>
				<tbody id="page_content">
					<?
					foreach($result as $key=>$val){
					?>
					<tr>

						<td width="10" align="center">
						<input type="checkbox" name="demand[]" id="demand_check_box" value="<?=$val->demand_id?>">
						</td>
						<td><?=$val->name?></td>
						<td><? 
						if(isset($required_level[$val->required_level])) 
							echo $required_level[$val->required_level];
						else 
							echo "";
						?></td>
						<td><?=intval($val->building_area1)."<br/>~<br/>".intval($val->building_area2)?></td>
						<td><?=intval($val->indoor_area1)."<br/>~<br/>".intval($val->indoor_area2)?></td>
						<td><?=intval($val->land_area1)."<br/>~<br/>".intval($val->land_area2)?></td>
						<td><?=$val->sections1."<br/>~<br/>".$val->sections2?></td>
						<td><?=$val->key_areas1."<br/>~<br/>".$val->key_areas2?></td>
						<td><?=$val->circle1."<br/>~<br/>".$val->circle2?></td>
						<td><?=intval($val->total_budget1)."<br/>~<br/>".intval($val->total_budget2)?></td>
						<td><?=$val->broker?></td>
						<td><? 
						if(isset($object_usage[$val->object_usage])) 
							echo $object_usage[$val->object_usage];
						else 
							echo "";
						?></td>
						<td><?
							$t_str="";
							if($val->type_rent=="1"){
									$t_str="租";
							}
							if($val->type_sell=="1"){
									$t_str="售";
							}
							if($val->type_consignment>0){
									$t_str="代銷";
							}
							echo $t_str;
						?></td>
						<td><?=date("Y/m/d",$val->ctime)?></td>
						<td width="70px">
						<?
						if($val->type_consignment>0){
						?>
						<a href="<?=site_url('/consignment/edit/'.$val->demand_id)?>"><img src="/images/ico_edit_16.png" title="編輯" border="0" />
						<?
						}else{
						?>
						<a href="<?=site_url('/demand/data_edit?id='.$val->demand_id)?>"><img src="/images/ico_edit_16.png" title="編輯" border="0" />
						<?
						}
						?>
						</a>

						<a href="<?=site_url('/pair/demand?id=').$val->demand_id ?>"><img src="/images/arrow-join.png" title="配对" border="0"/></a>
						<a href="<?=site_url('/demand/data_delete/'.$val->demand_id)?>"><img src="/images/ico_delete_16.png" title="刪除" border="0"/></a>
						</td>
					</tr>
					<?
					}
					?>					
				</tbody>
				<tfoot>
				<tr>
					<td colspan="15">
					<div>

						<div style="float:left;vertical-align:baseline">&nbsp;
						<input type="checkbox" name="select_demand" id="select_demand" onclick="selectCheckBox()" >&nbsp;
						<span class="allchoose">全选</span>
						<!--&nbsp;&nbsp;
						<input type="submit" onclick="checkform()" value="批量刪除">&nbsp;-->
						&nbsp;&nbsp;
						<!--
						<input type="button"  value="轉EXCEL" onclick="window.open('<?=site_url('/demand/excel')?>','newwindow','resizable=yes,location=no');" class="input_background">
						-->
						<input type="button"  value="轉EXCEL" id="demand_do_excel" class="input_background" >
						<!--
                        <input type="button"  value="轉EXCEL_for_selected" id="demand_do_excel_for_selected" class="input_background" >
						-->
						</div>


						<?php echo $victor_page; ?> 
						<div style="float:right;display:none;">

<?php // if($page['num_pages']>1){?>
							 <div class="pager fl"> 
							 <span class="nav" id="pagination_previous_span"> 
							 </span>
							 <input type="hidden" id="pagination_query_condition" name="pagination_query_condition" value="<?//=$query_condition?>">

							<input type="hidden" id="pagination_sequence" name="pagination_sequence" value="<?//=$sequence?>">
							<span class="pages"> 共
                        	<input id="pagination_pages" class="post" type="text" value="1" name="pagination_pages" style="width:20px;">
                        /<? //=$page['num_pages']?> </span> <input type="hidden" id="pagination_num_pages" name="pagination_num_pages" value="<?//=$page['num_pages']?>">
							<input type="hidden" id="pagination_url" name="pagination_url" value="<?//=$page['url']?>">
							<span class="nav" id="pagination_next_span"> 
							<a title="next page" class="next" href="#" onclick='pagination_next()'>
							<span>Next</span>
							</a> 
							<a title="last page" class="last" href="#" onclick='pagination_last()'>
							<span>Last</span></a> 
							</span> 
							<?
							//}else{
							?>
							<span class="pages">共<?=$page['num_pages']?>頁</span>
							<?
							//}
							?>

							<?php echo $victor_page; ?>
							</div>
						</div>
					</div>
					</td>
				</tr>
				</tfoot>
			</table>
			</form>
	</div>
</div>
<?=isset($footer) ? $footer : ''?>